package com.bjsxt.login.controller;

import com.bjsxt.login.service.LoginService;
import com.livegoods.commons.vo.LivegoodsResult;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 * @ClassName : LoginController
 * @Description :
 * @Author : ZWZ
 * @Date: 2021/8/27 10:20
 */
@RestController
@CrossOrigin
public class LoginController {

    @Resource
    private LoginService loginService;

    /**
     * 发送验证码
     *
     * @return
     */
    @PostMapping("/sendyzm")
    public LivegoodsResult sendYzm(String phone) {
        return loginService.sendYzm(phone);
    }


    /**
     * 登录
     *
     * @return
     */
    @PostMapping("/login")
    public LivegoodsResult login(String username, String password) {
        return loginService.login(username, password);
    }

}
